package com.jswdwsx.esign.util;

import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper

val jacksonMapper: ObjectMapper = jacksonObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)


fun <T> T.json(mapper: ObjectMapper = jacksonMapper): String {
    return mapper.writeValueAsString(this)
}

